package com.ruoyi.business.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 审批状态
 *
 * @author Tellsea
 * @date 2024/1/16
 */
@Getter
@AllArgsConstructor
public enum AuditStatusEnums {

    SAVE(0L, "暂存"),
    NO(1L, "待审批"),
    WAIT(2L, "转审中"),
    SUCCESS(3L, "审批通过"),
    FAIL(4L, "审批拒绝"),
    RETURNED(5L, "已退回"),
    ;

    private final Long code;
    private final String name;

    public static String getNameByCode(Long code) {
        for (AuditStatusEnums enums : AuditStatusEnums.values()) {
            if (enums.getCode().equals(code)) {
                return enums.getName();
            }
        }
        return "";
    }
}
